﻿@*
<!-- A Great Example of boottom fixed container -->
<nav class="navbar navbar-default navbar-fixed-bottom">
    <div class="container-fluid">
        <ul class="nav navbar-nav navbar-right">
            <li><a href="#">Loan</a></li>
            <li><a href="#">Rental</a></li>
            <li><a href="#">Developers</a></li>
            <li><a href="#">Jont Venture</a></li>
        </ul>
    </div>
</nav>*@

<footer>
    <div class="rh-footer">
        <div class="container">
            <div class="row">
                <div class="col-md-3">
                    <h1>Company</h1>
                    <ul>
                        <li><a href="#">About Rehab Housing</a></li>
                        <li><a href="#">Contact Corporate</a></li>
                        <li><a href="#">Feedback</a></li>
                        <li><a href="#">Privacy Policy</a></li>
                        <li><a href="#">Terms and Conditions</a></li>
                    </ul>
                </div>
                <div class="col-md-3">
                    <h1>Our Services</h1>
                    <ul>
                        <li><a href="#">FAQ</a></li>
                        <li><a href="#">Site Map</a></li>
                        <li><a href="#">Our Services</a></li>
                        <li><a href="#">Media Reports</a></li>
                    </ul>
                </div>
                <div class="col-md-3">
                    <h1>Useful Links</h1>
                    <ul>
                        @if (SessionCache.CurrentUser == null)
                        {
                            <li><a href="/account/login">Login</a></li>
                            <li><a href="/company/register">Register your company</a></li>
                        }
                        else
                        {
                            <li><a href="/Account/Logoff">Logoff</a></li>
                        }
                        <li><a href="/product/search">Search</a></li>
                    </ul>
                </div>
                <div class="col-md-3">
                    <h1>Subscribe to newsletter</h1>
                    <ul>                       
                        <li>
                            <div class="input-group">
                                <input class="form-control" type="text" id="f_txtSubscribeNewsLetter" name="f_txtSubscribeNewsLetter" value="" placeholder="Enter your email" />
                                <span class="input-group-btn pull-left">
                                    <button class="btn btn-success" type="button"><i class="glyphicon glyphicon-floppy-disk"></i></button>
                                </span>
                            </div>
                        </li>
                    </ul>

                    <h1>Social connectivity</h1>                    
                    @*<img src="/Content/Images/facebook_icon.png" alt="Facebook" title="Facebook" />
                    <img src="/Content/Images/twitter_icon.png" alt="Twitter" title="Twitter" />
                    <img src="/Content/Images/flickr_icon.png" alt="Flickr" title="Flickr" />*@
                    <ul>
                        <li><a href="#">Twitter</a></li>
                        <li><a href="#">Facebook</a></li>
                        <li><a href="#">Linkedin</a></li>
                        <li><a href="#">Instagram</a></li>
                    </ul>                    
                </div>
            </div>
        </div>
        <hr />
        <div class="container">
            <div class="row">
                <div class="col-md-5">
                    <small>
                        <i>
                            <a href="/" class="rh-footer-copyright">
                                Copyright<sup>&copy;</sup> @DateTime.Now.Year  RehabHousing.com<sup>&reg;</sup>, all rights reserved<br />
                                www.RehabHousing.com<sup>&reg;</sup>.
                            </a>
                        </i>
                    </small>
                </div>
                <div class="col-md-2">
                    <center>
                        <img src="~/Content/Images/logo.png" alt="Rehab Housing Logo" title="Rehab Housing Logo" />
                    </center>
                </div>
                <div class="col-md-5"></div>
            </div>
        </div>
    </div>
</footer>

@*FIXME: Should be replaced with a Bootstrap modal dialog. Can be availabe somewhere in this project already for reuse.*@
<div class="bm-dialog"  id="divMessageBox" style="display:none">
    <div>            
        <div class="bm-dialog-title">Newsletter Subscription</div>
    </div>
    <div class="bm-dialog-body" style="min-height:60px;" id="dvMsg">
                             
    </div>
    <div class="bm-dialog-button" style="height:15px;"></div>
</div>


<script language="javascript" type="text/javascript">
    function AddRemoveNewsLetter() {
        if ($('#footer_middle_searchbox').val() != 'ENTER YOUR EMAIL') {
            if (isValidEmailAddress($('#footer_middle_searchbox').val())) {
                var url = '@Url.Action("AddRemoveNewsLetter", "Product", new { area = AppConstants.Area.PUBLIC })';
                Ajax(url, 'email=' + $('#footer_middle_searchbox').val(), function (isAdded) {
                    if (isAdded) {
                        ShowDialogMessage('You subscribe the newsletter successfully');
                    }
                    else
                        ShowDialogMessage('You already subscribed the news letter');           
                });
            }
            else                
                ShowDialogMessage('Please insert a valid email address');
        }
        else
            ShowDialogMessage('Please insert a valid email address');
    }

    function ShowDialogMessage(Message) {
        var $msgDiv = $('#dvMsg');
        $msgDiv.show().html(Message);

        var $messageDiv = $('#divMessageBox');
        $messageDiv.show();
        setTimeout(function () { $messageDiv.hide(); }, 3000);
    }

    function isValidEmailAddress(emailAddress) 
    {
        var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
        return pattern.test(emailAddress);

    }
        

</script>
            
            
            
            
        